<?php

class Work extends \Eloquent {
	protected $fillable = [];


    public static function addWork($name,$mobile,$section_id,$city){
        $work = new Work;
        $work->name   = $name;
        $work->mobile   = $mobile;
        $work->avatar = URL::asset('ad/img/default_small.jpg');
        $work->city   = $city;
        $work->section_id   = $section_id;
        $work->count   = 0;
        $work->save();
        return $work->id;
    }

    public function section(){
        return $this->hasOne('Area', 'id','section_id');
    }
}